# 49. API集群负载统计
const readline = require('readline');
const rl = readline.createInterface({
input: process.stdin,
output: process.stdout,
});
let lines = [];
rl.on('line', function(line) {
lines.push(line);
});
let map={};
rl.on('close', () => {
let N = parseInt(lines[0]);
for(let i=1; i<=N; i++) {
let parts = lines[i].split('/');
for(let j=1; j<parts.length; j++) {
let key = j.toString() + '-' + parts[j];
map[key] = (map[key] || 0) + 1;
}
}
let [L, keyword] = lines[N + 1].split(' ');
console.log(map[L + '-' + keyword] || 0);
})
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22